package com.sgb.kjwl.view.widget.map;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sgb.kjwl.R;
import com.swgk.core.dialog.BaseBottomDialog;
import com.swgk.core.dialog.DialogViewHolder;

@Deprecated
public class PackerMapInfoDialog3 extends BaseBottomDialog {
    private TextView startView;
    private TextView endView;
    private TextView navigationView;
    private ImageView closeView;
    private DialogClickCallBack dialogClickCallBack;

    public PackerMapInfoDialog3(Context context, DialogCallBack dialogCallBack) {
        super(context, dialogCallBack);
    }

    public PackerMapInfoDialog3(Context context, int theme, DialogCallBack dialogCallBack) {
        super(context, theme, dialogCallBack);
    }

    @Override
    protected int dialogLayout() {
        return R.layout.packer_map_info_pop3;
    }

    @Override
    protected void initView(DialogViewHolder holder, Bundle savedInstanceState) {
        startView = holder.getDialog().findViewById(R.id.start_view);
        endView = holder.getDialog().findViewById(R.id.end_view);
        closeView = holder.getDialog().findViewById(R.id.close_view);
        navigationView = holder.getDialog().findViewById(R.id.navigation_view);
        navigationView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (dialogClickCallBack == null) {
                    return;
                }
                dialogClickCallBack.onClickNavigation();
            }
        });
        closeView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

    public PackerMapInfoDialog3 setStartData(String start) {
        startView.setText(start);
        return this;
    }

    public PackerMapInfoDialog3 setEndData(String end) {
        endView.setText(end);
        return this;
    }


    public interface DialogClickCallBack {
        void onClickNavigation();
    }

    public PackerMapInfoDialog3 setDialogClickCallBack(DialogClickCallBack dialogClickCallBack) {
        this.dialogClickCallBack = dialogClickCallBack;
        return this;
    }
}
